<%--
  Created by IntelliJ IDEA.
  User: onion
  Date: 2018/7/17
  Time: 23:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--引入标签库--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>欢迎登录员工管理系统</title>
    <jsp:include page="/WEB-INF/jsp/css.jsp"/>
    <style>
        .add{
            color: #777;
        }
        .add:hover{
            color: #333;
        }
    </style>
</head>
<body>
<!-- 引入导航栏 -->
<jsp:include page="../header.jsp" />
<div class="container">
    <div class="table-responsive" style="overflow: inherit">
        <table class="table">

            <!-- 高级查询 start -->
            <form class="form-horizontal" action="query.html" method="get">
                <div class="row">
                    <div class="col-lg-2">
                        <div class="input-group">
                            <span class="input-group-addon">
                                <span>姓名</span>
                            </span>
                            <input type="text" class="form-control" placeholder="姓名"  name="name" value="${name}"/>
                        </div><!-- /input-group -->

                    </div><!-- /.col-lg-6 -->
                    <div class="col-lg-2">
                        <div class="input-group">
                            <span class="input-group-addon">
                                <span>年龄</span>
                            </span>
                            <input type="text" class="form-control" placeholder="年龄" name="age">
                        </div><!-- /input-group -->
                    </div><!-- /.col-lg-6 -->
                </div><!-- /.row -->
                <br />
                <div class="row">
                    <div class="col-lg-2">
                        <div class="input-group">
                            <span class="input-group-addon">
                                <span>工资大于</span>
                            </span>
                            <input type="text" class="form-control" placeholder="工资下限" name="salMin">
                        </div><!-- /input-group -->

                    </div><!-- /.col-lg-6 -->
                    <div class="col-lg-2">
                        <div class="input-group">
                            <span class="input-group-addon">
                                <span>工资小于</span>
                            </span>
                            <input type="text" class="form-control" placeholder="工资的上限" name="salMax">
                        </div><!-- /input-group -->
                    </div><!-- /.col-lg-6 -->
                </div><!-- /.row -->

                <br />
                <div class="row">
                    <div class="col-lg-2">
                        <div class="input-group">
                            <span class="input-group-addon">
                                <span>性别</span>
                            </span>
                            <input type="text" class="form-control" placeholder="性别" name="gender">
                        </div><!-- /input-group -->

                    </div><!-- /.col-lg-6 -->
                    <div class="col-lg-2">
                        <div class="input-group">
                            <span>
                                <span>&nbsp;</span>
                            </span>
                            <button type="submit" class="btn btn-default">查询</button>
                        </div><!-- /input-group -->
                    </div>

                </div><!-- /.row -->
            </form>
            <!-- 高级查询 end -->

            <caption>员工列表&nbsp; &gt;<a href="/addEmp.html" class="add">增加员工</a></caption>
            <thead>
            <tr>
                <th>员工姓名</th>
                <th>身份证号码</th>
                <th>电话号码</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach var="emp" items="${empList}">
                <tr>
                    <td>${emp.name}</td>
                    <td>${emp.idCardNo}</td>
                    <td>${emp.tel}</td>
                    <td>
                        <a href="/updateEmp.html?id=${emp.id}" class="a_button">修改</a>
                        <a href="delete.html?id=${emp.id}" onclick="return confirm('是否删除${emp.name}信息？')"  class="a_button">删除</a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>

        <ul class="pagination">
            <!--分页-->
            <li><a href="listEmp.html?current=1&size=${page.size}">首页</a></li>
            <c:if test="${page.current > 1}">
                <li><a href="listEmp.html?current=${page.current - 1}&size=${page.size}">&laquo;</a></li>
            </c:if>
            <c:forEach var="p" begin="1" end="${page.total}" step="1">
                <li <c:if test="${page.current == p}">class="active"</c:if> ><a href="listEmp.html?current=${p}&size=${page.size}">${p}</a></li>
            </c:forEach>

            <c:if test="${page.current < page.total}">
                <li><a href="listEmp.html?current=${page.current + 1}&size=${page.size}">&raquo;</a></li>
            </c:if>

            <li><a href="listEmp.html?current=${page.total}&size=${page.size}">末页</a></li>
        </ul>
    </div>
</div>
</body>
</html>